<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Swoole\Table class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="swoole-server.tick.html">« Swoole\Server::tick</a></li>
      <li style="float: right;"><a href="swoole-table.column.html">Swoole\Table::column »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.swoole.html">Swoole</a></li>
    <li>The Swoole\Table class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.swoole-table" class="reference">

 <h1 class="title">The Swoole\Table class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL swoole &gt;= 1.9.0)</p>


  <div class="section" id="swoole-table.intro">
   <h2 class="title">简介</h2>
   <p class="para">

   </p>
  </div>


  <div class="section" id="swoole-table.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">Swoole\Table</strong>
     </span>
     
     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.iterator.html" class="interfacename">Iterator</a></span><span class="oointerface">,  <a href="class.countable.html" class="interfacename">Countable</a></span> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.swoole-table.html#swoole-table.constants.type-int"><var class="varname">TYPE_INT</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.swoole-table.html#swoole-table.constants.type-string"><var class="varname">TYPE_STRING</var></a></var><span class="initializer"> = 7</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.swoole-table.html#swoole-table.constants.type-float"><var class="varname">TYPE_FLOAT</var></a></var><span class="initializer"> = 6</span>;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="swoole-table.column.html" class="methodname">column</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$type</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$size</code><span class="initializer"> = ?</span></span>): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.count.html" class="methodname">count</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.create.html" class="methodname">create</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.current.html" class="methodname">current</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.decr.html" class="methodname">decr</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$column</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$decrby</code><span class="initializer"> = ?</span></span>): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.del.html" class="methodname">del</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.destroy.html" class="methodname">destroy</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.exist.html" class="methodname">exist</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.get.html" class="methodname">get</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$row_key</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$column_key</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.incr.html" class="methodname">incr</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$column</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$incrby</code><span class="initializer"> = ?</span></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.key.html" class="methodname">key</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.next.html" class="methodname">next</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.rewind.html" class="methodname">rewind</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.set.html" class="methodname">set</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$value</code></span>): <span class="type"><span class="type VOID">VOID</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-table.valid.html" class="methodname">valid</a></span>(): <span class="type">bool</span></div>

   }</div>


  </div>
  

  <div class="section" id="swoole-table.constants">
   <h2 class="title">预定义常量</h2>
   <dl>

    
     <dt id="swoole-table.constants.type-int"><strong><code>Swoole\Table::TYPE_INT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="swoole-table.constants.type-string"><strong><code>Swoole\Table::TYPE_STRING</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="swoole-table.constants.type-float"><strong><code>Swoole\Table::TYPE_FLOAT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

   </dl>

  </div>



 </div>

 

















































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="swoole-table.column.html">Swoole\Table::column</a> — Set the data type and size of the columns.</li><li><a href="swoole-table.construct.html">Swoole\Table::__construct</a> — Construct a Swoole memory table with fixed size.</li><li><a href="swoole-table.count.html">Swoole\Table::count</a> — Count the rows in the table, or count all the elements in the table if $mode = 1.</li><li><a href="swoole-table.create.html">Swoole\Table::create</a> — Create the swoole memory table.</li><li><a href="swoole-table.current.html">Swoole\Table::current</a> — Get the current row.</li><li><a href="swoole-table.decr.html">Swoole\Table::decr</a> — Decrement the value in the Swoole table by $row_key and $column_key.</li><li><a href="swoole-table.del.html">Swoole\Table::del</a> — Delete a row in the Swoole table by $row_key.</li><li><a href="swoole-table.destroy.html">Swoole\Table::destroy</a> — Destroy the Swoole table.</li><li><a href="swoole-table.exist.html">Swoole\Table::exist</a> — Check if a row is existed by $row_key.</li><li><a href="swoole-table.get.html">Swoole\Table::get</a> — Get the value in the Swoole table by $row_key and $column_key.</li><li><a href="swoole-table.incr.html">Swoole\Table::incr</a> — Increment the value by $row_key and $column_key.</li><li><a href="swoole-table.key.html">Swoole\Table::key</a> — Get the key of current row.</li><li><a href="swoole-table.next.html">Swoole\Table::next</a> — Iterator the next row.</li><li><a href="swoole-table.rewind.html">Swoole\Table::rewind</a> — Rewind the iterator.</li><li><a href="swoole-table.set.html">Swoole\Table::set</a> — Update a row of the table by $row_key.</li><li><a href="swoole-table.valid.html">Swoole\Table::valid</a> — Check current if the current row is valid.</li></ul>
</div>
</div></div></body></html>